SetCursorPosition(int, int)

Method

Namespace: ANSITerm

Declared in: ANSITerm.IConsoleBackend


Sets the cursor position.

Syntax

public void SetCursorPosition(
	int x,
	int y
)

Parameters

x

Ranges from 0 to WindowWidth - 1

y

Ranges from 0 to WindowHeight - 1

Remarks

Note: the origin is equal to 0, 0 and is located on the top-left corner of the terminal part after the application invocation line, e.g.:

user@host:~$ dotnet MyAwesomeApp.dll
Hello, world!
The 'H' symbol is located at 0, 0 in this case, which should feel pretty familiar to most UNIX terminal users. On Windows this behaviour is emulated by saving initial cursor position when the console is initialized and offsetting by it.

See also

  • SetCursorPosition(Point)

  • Back to index